// subpkg/test/test.js
Page({
  //.js
  data: {
    imgUrls: [
      'https://p0.pipi.cn/mmdb/fb7386333393399257b12d2bdf368cb769813.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a9235c7ed11e14a265302a9b.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a8ea38ea34efb781c44a0ea1.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537ddd06d6b535b5b7e208afc817f.jpg?imageMogr2/thumbnail/2500x2500%3E'
    ],
    currentIndex: 0
  },

  bindchange(e) {
    this.setData({
      currentIndex: e.detail.current
    })
  },
  toggle(e) {
    this.setData({
      currentIndex: e.target.dataset.index
    })
  }
})